package com.cmc.cloud.cmclink.doc.mapper;

import com.cmc.cloud.cmclink.doc.entity.DgCommodityDO;
import com.cmes.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 危险品品名库 Mapper
 *
 * @author 集运管理员
 */
@Mapper
public interface DgCommodityMapper extends BaseMapperX<DgCommodityDO> {
    /**
     * 危险品品名库查询
     *
     * @param unNo
     * @return
     */
    @Select("SELECT * FROM  doc_dg_commodity WHERE un_no LIKE  CONCAT('%',#{unNo},'%')  AND ENABLE = TRUE ")
    List<DgCommodityDO> selectDgCommodityInfo(String unNo);

    @Select("SELECT version_no FROM doc_dg_commodity WHERE deleted = 0 AND enable = TRUE LIMIT 1")
    String getLatestVersion();
}
